<?php

namespace PAT\ProductBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * PAT\ProductBundle\Entity\Stock
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="PAT\ProductBundle\Entity\StockRepository")
 */
class Stock
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $status
     *
     * @ORM\Column(name="status", type="string", length=255)
     */
    private $status;
	
	/**
     * @ORM\OneToMany(targetEntity="PAT\ProductBundle\Entity\Product", mappedBy="stock")
     */
	 private $products;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set status
     *
     * @param string $status
     * @return Stock
     */
    public function setStatus($status)
    {
        $this->status = $status;
    
        return $this;
    }

    /**
     * Get status
     *
     * @return string 
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set number
     *
     * @param integer $number
     * @return Stock
     */
    public function setNumber($number)
    {
        $this->number = $number;
    
        return $this;
    }

    /**
     * Get number
     *
     * @return integer 
     */
    public function getNumber()
    {
        return $this->number;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->products = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add products
     *
     * @param PAT\ProductBundle\Entity\Product $products
     * @return Stock
     */
    public function addProduct(\PAT\ProductBundle\Entity\Product $products)
    {
        $this->products[] = $products;
		$products->setStock($this);
        return $this;
    }

    /**
     * Remove products
     *
     * @param PAT\ProductBundle\Entity\Product $products
     */
    public function removeProduct(\PAT\ProductBundle\Entity\Product $products)
    {
        $this->products->removeElement($products);
		$products->setStock(null);
    }

    /**
     * Get products
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getProducts()
    {
        return $this->products;
    }
}